package com.markul.android.ui.dialog

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.activity.viewModels
import com.markul.android.MarkulApplication
import com.markul.android.R
import kotlinx.android.synthetic.main.activity_dialog.*

class DialogActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_dialog)
        title=null
        val viewModel: DialogViewModel by viewModels()
        val position=intent.getIntExtra("position",0)
        cancelBtn.setOnClickListener {
            finish()
        }

        deleteBtn.setOnClickListener {
            viewModel.deleteAlbumAndPhotos(position)
            MarkulApplication.delId=position
            finish()
        }
    }
}